package com.crrc.utils;

public class FieldUtils {

    /**
     * 驼峰命名转换为下划线命名
     */
    public static String camelToSnake(String str) {
        StringBuilder result = new StringBuilder();
        for (char c : str.toCharArray()) {
            if (Character.isUpperCase(c)) {
                result.append('_').append(Character.toLowerCase(c));
            } else {
                result.append(c);
            }
        }
        return result.toString();
    }
}
